<%-- 
    Document   : homeWarehousing
    Created on : Sep 13, 2013, 9:32:22 AM
    Author     : Trang
--%>
<%@page import="model.Role"%>
<%@page import="model.Staff"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<%
    Staff staff = (Staff) session.getAttribute("staff");

    if (staff == null) {
        response.sendRedirect(request.getContextPath() + "/Administration");
    } else if (!staff.getRoleList().contains(new Role(3))) {
        response.sendRedirect(request.getContextPath() + "/Administration/home");
    } else {
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Warehousing Management</title>
        <link href="<%= request.getContextPath()%>/css/style_for_page.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_menu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_addtion.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/adMenu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/tHeaderFooter.css" rel="stylesheet" type="text/css"/>
    </head>
    <body class="container">
        <header>
            <div class="header"> 
                <%@include file="/include/mHeader.jsp" %>
            </div>
            <div class="adContent">
                <div class="adMenu">
                    <%@include file="/include/mMenu.jsp" %>
                </div>
            </div>

        </header>
        <div class="content">
            <div class="registerbg" >
                <div class="registerForm">
                    <s:form >
                        <s:textfield name="firstname" label="First Name" size="30" disabled="false" value="%{staff.firstname}" readonly="true"/>
                        <s:textfield name="lastname" label="Last Name" size="30" disabled="false" value="%{staff.lastname}" readonly="true"/>
                        <s:textfield name="loginName" label="Login Name" size="30" disabled="false" value="%{staff.loginName}" readonly="true"/>
                        <s:textfield name="role"    label="Role" size="30" disabled="false" value="%{staff.role}"/>
                        <s:textfield name="dob"    label="Birth Date" size="30" disabled="false" value="%{staff.dob}" readonly="true"/>
                        <s:textfield name="openTime"    label="Open Time" size="30" disabled="false" value="%{staff.openTime}"/>
                        <s:textfield name="closeTime"    label="Close Time" size="30" disabled="false" value="%{staff.closeTime}"/>
                        <s:textfield name="email"  label="E-Mail" size="30" disabled="false" value="%{staff.email}" readonly="true"/>
                        <s:hidden name="hiddenStaffID"/>
                        <table>
                            <tr>
                                <td>
                                    <s:reset value="Reset" cssStyle="width: 96px" theme="simple" />
                                </td>
                                <td>
                                    <s:submit namespace="/Administration/Staff" action="editInfor" value="Update" cssStyle="width: 96px; margin-left: 90px" theme="simple" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2"><s:actionerror /></td>
                            </tr>
                        </table>
                    </s:form>
                </div>
                <div class="registerTerms2">
                    <h1>Edit Staff Note</h1>
                    </br>
                    <p>- <b>You cannot edit Login Name</b></p>
                    <p>- <b>You cannot edit Password</b></p>
                    <p>- Role field cannot be empty</p>
                    <p>- Open date should be in <b>mm/dd/yyyy</b> format (e.g. 02/28/2000).</p>
                    <p>- Close date should be in <b>mm/dd/yyyy</b> format (e.g. 02/28/2000).</p>
                    <br>   
                </div>
            </div>
        </div>  
        <footer>
            <div id="footer">
                <%@include file="/include/iFooter.jsp" %>
            </div>   
        </footer>

    </body>
</html>
<%
    }
%>